<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
	<script src="lib/react.development.js"></script>
	<script src="lib/react-dom.development.js"></script>
	<script src="lib/babel.min.js"></script>
</head>
<body>
<div id="root"></div>
</body>
<script type="text/babel">
	// 1- 使用箭头函数
	// 如果写的逻辑比较简单且不会被重复使用，那么可以使用箭头函数
	const root = ReactDOM.createRoot(document.querySelector("#root"));
	class App extends React.Component{
		username = "wangwu";
		render(){
			return (
				<div>
					<h3 onClick={()=>{
						console.log(this.username)
					}}>App:{this.username}</h3>
				</div>
			)
		}
	}
	root.render(<App/>);
</script>
</html>